//get请求
export  let getData=(url)=>{
   let Promise= fetch(url).then(res=>res.json())


   return  Promise

}

// post 请求封装 

export   let  postData=(url,data)=>{
let  Promise=fetch(url,{
    body: JSON.stringify(data), // must match 'Content-Type' header
    headers: {
      'content-type': 'application/json'
    },
    method: 'POST', // *GET, POST, PUT, DELETE, etc.

}).then(res=>res.json())
   return    Promise
}






